package com.gitee.wsl.net.exceptions

import io.ktor.http.HttpStatusCode

/**
 * Errors app
 */
open class Exceptions(
    open val status: HttpStatusCode,
) : RuntimeException() {

    data class MethodNotAllowed(
        override val status: HttpStatusCode = HttpStatusCode.MethodNotAllowed
    ) : Exceptions(status)

    data class BadRequest(
        override val status: HttpStatusCode = HttpStatusCode.BadRequest
    ) : Exceptions(status)

    data class Unauthorized(
        override val status: HttpStatusCode = HttpStatusCode.Unauthorized
    ) : Exceptions(status)

    data class Forbidden(
        override val status: HttpStatusCode = HttpStatusCode.Forbidden
    ) : Exceptions(status)

    data class NotFound(
        override val status: HttpStatusCode = HttpStatusCode.NotFound
    ) : Exceptions(status)


    data class JsonDecodingException(
        override val status: HttpStatusCode = HttpStatusCode.BadRequest
    ) : Exceptions(status)

}
